// JavaScript Document
<!--
getTimeNow();
function getTimeNow() {
var time = new Date();

var year = time.getYear();
var month= (time.getMonth()+1);
var day = time.getDate();
var hour = time.getHours();
var minute = time.getMinutes();
var second = time.getSeconds();

var week = new Array(7);
week[0]="天";
week[1]="一";
week[2]="二";
week[3]="三";
week[4]="四";
week[5]="五";
week[6]="六";

//document.getElementById("showTime").innerHTML = year +"年"+month+"月"+day+"日"+" "+" 星期"+week[time.getDay()]+" "+ hour+":"+minute+":"+second
//setTimeout("getTimeNow()",1000)
}
function date()
{
	var d=new Date();
	var ymd=d.getFullYear()+"年"+(d.getMonth()+1)+"月"+d.getDate()+"日", week=['日', '一', '二', '三', '四', '五', '六'];
	return ymd+" 农历"+lunar(d)+" 星期"+week[d.getDay()];
}
function lunar(d){
	var nums="一二三四五六七八九十",mons="正二三四五六七八九十冬腊";
	var Cal=[0x41A95,0xD4A,0xDA5,0x20B55,0x56A,0x7155B,0x25D,0x92D,0x5192B,0xA95,0xB4A,0x416AA,0xAD5,0x90AB5,0x4BA,0xA5B,0x60A57,0x52B,0xA93,0x40E95];
	var madd=[0,31,59,90,120,151,181,212,243,273,304,334];
	var total,m,n,k,isEnd=false,t=d.getYear();
	if (t<1900) t+=1900;
	total=(t-2001)*365+Math.floor((t-2001)/4)+madd[d.getMonth()]+d.getDate()-23;
	if(d.getYear()%4==0&&d.getMonth()>1) total++;
	for(m=0;;m++){
		k=(Cal[m]<0xfff)?11:12;
		for(n=k;n>=0;n--){
			if(total<=29+getBit(Cal[m],n)){
				isEnd=true;
				break;
			}
			total=total-29-getBit(Cal[m],n);
		}
		if(isEnd) break;
	}
	var cYear=2001+m,cMonth=k-n+1,cDay=total;
	if(k==12){
		if(cMonth==Math.floor(Cal[m]/0x10000)+1)cMonth=1-cMonth;
		if(cMonth>Math.floor(Cal[m]/0x10000)+1) cMonth--;
	}
	var t="";
	if(cMonth<1){
		t+="闰";
		t+=mons.charAt(-cMonth-1);
	}
	else{
		t+=mons.charAt(cMonth-1);
	}
	t+="月";
	t+=(cDay<11)?"初":((cDay<20)?"十":((cDay<30)?"廿":"卅"));
	if(cDay%10!=0||cDay==10)t+=nums.charAt((cDay-1)%10);
	return t;
}
function getBit(m,n){
	return (m>>n)&1
}